<cfset request.repoBrowser = viewstate.getValue("repoBrowser")>
<cfset mySelf = viewState.getValue("mySelf") />
<cfinclude template="../model/tree/dojotree.cfm">

<cfoutput><html>
<head>
<title>Repotree</title>

<script type="text/javascript">
	var djConfig = {isDebug: true,
		debugContainerId : "resourceHistory" };
</script>

<script type="text/javascript" src="/inc/dojo/dojo.js"></script>

<script type="text/javascript">
	dojo.require("dojo.widget.*");
	dojo.require("dojo.widget.TreeV3");
	dojo.require("dojo.widget.TreeNodeV3");
	dojo.require("dojo.widget.TreeRpcControllerV3");
	dojo.require("dojo.widget.TreeDndControllerV3");
	dojo.require("dojo.widget.TreeLinkExtension");
	<!---dojo.require("dojo.widget.TreeEditor"); --->
	dojo.require("dojo.widget.TreeContextMenuV3");	
	dojo.require("dojo.widget.TreeSelectorV3");
	dojo.require("dojo.widget.TreeEmphasizeOnSelect");
	dojo.require("dojo.widget.TreeDemo");
	dojo.require("dojo.lfx.rounded");
	dojo.hostenv.writeIncludes();
</script>

<style>

div.dojoTree {
font-size:10px;
}
div.TreeNode {
	font-size:12px;
 /*   margin-left: 8px; */
}

.treeColumn {
	width:25%;
	vertical-align: top;
	text-align: middle;
	border:1px black dashed;
}
.rounders {
	border:1px solid ##ccc;
	padding:5px;
	margin-top:10px;
}

</style>

<script type="text/javascript">

        dojo.addOnLoad(function(){
					/* bind demo actions to menu-tree */ 
         		dojo.widget.TreeDemo.bindDemoMenu(dojo.widget.byId('controller'));
						dojo.lfx.rounded({
								tl:{ radius:10 },
								bl:{ radius:10 },
								tr:{ radius:10 },
								br:{ radius:10 }
							}, 
							["treeFrameRounder"]
						);
				});

</script>
</head>
<body>
	<div id="treeFrameRounder" class="rounders">

<div dojoType="TreeSelectorV3" widgetId="selector"></div>	

<!-- selector extensions -->
<div dojoType="TreeEmphasizeOnSelect" selector="selector"></div>

<!--- <div dojoType="TreeEditor" widgetId="editor"></div> --->

<div dojoType="TreeRpcControllerV3" widgetId="controller"<!--- editor="editor" ---> RpcUrl="?event=repo.treeaction&runaction=true"></div>

<div dojoType="TreeDndControllerV3" controller="controller" widgetId="dndcontroller"></div>

<div dojoType="TreeExpandToNodeOnSelect" selector="selector" controller="controller"></div>    
<div dojoType="TreeToggleOnSelect" selector="selector" selectEvent="dblselect" controller="controller"></div>


<div dojoType="TreeContextMenuV3" toggle="explode" contextMenuForWindow="false" widgetId="contextMenu">
	<div dojoType="TreeMenuItemV3" treeActions="addChild" iconSrc="static/createsmall.gif" widgetId="treeContextMenuCreate" caption="Create"></div>
	<div dojoType="TreeMenuItemV3" treeActions="remove" iconSrc="static/removesmall.gif" caption="Remove" widgetId="treeContextMenuDestroy"></div>
	<div dojoType="TreeMenuItemV3" treeActions="move" iconSrc="static/downsmall.png" caption="Up" widgetId="treeContextMenuUp"></div>
	<div dojoType="TreeMenuItemV3" treeActions="move" iconSrc="static/upsmall.png" caption="Down" widgetId="treeContextMenuDown"></div>
	<div dojoType="TreeMenuItemV3" treeActions="edit" caption="Edit" widgetId="treeContextMenuEdit"></div>
</div>


<div style="display:none">
	<!-- IE has a bug: it reloads all dynamically resolved images, no matter, is it
	new Image() or CSS background. If you don't specify images like that,
	it will reload them every time a node is expanded -->
	<img src="images/TreeV3/i.gif">
	<img src="images/TreeV3/i_half.gif">
	<img src="images/TreeV3/expand_minus.gif">
	<img src="images/TreeV3/expand_plus.gif">
	<img src="images/TreeV3/expand_leaf.gif">
	<img src="images/TreeV3/i_long.gif">
	<img src="images/TreeV3/document.gif">
	<img src="images/TreeV3/open.gif">
	<img src="images/TreeV3/closed.gif">
</div>	
	<div dojoType="TreeLinkExtension" widgetId="link" params="onclick:return loadResource(this.href.toString());"></div>	

		<strong onclick="dojo.widget.byId('repoTree').setUrl('#myself#repotree')">/ (click to refresh)</strong>
		<div dojoType="TreeV3" eagerWidgetInstantiation="true" DNDMode="between;onto" listeners="link;controller;dndcontroller;selector;contextMenu" toggler="fade" widgetId="tree1" class="rounders" objectId="tree">
		#getParents(1)#
		</div>
<!---
		<hr>
		<div id="treeDebug"></div>
		<input type="button" value="Save expanded" onClick="saveExpandedIndices()"/>
 --->
</div>
</body>
</html></cfoutput>